<html>
<head>
	<meta charset="utf-8">
	<title></title>
	<!-- <script type="text/javascript" src="js/index.js"></script> -->
	
	<style type="text/css">
     #time{
      text-align: center;
      font-size: 30px;
      color: #ff0000;
      font-family: '微软雅黑';
      font-weight: bolder;
     }
  
  </style>


</head>
<body>
  <div id="time"></div>
  <script type="text/javascript">
		// num(150);
		// // 正三角形
		// document.write("<hr>");
		// triangle(5);
		// // 倒三角形
		// document.write("<hr>");
		// inverted(10);
		// // 菱形
		// document.write("<hr>");
		// diamond(5);
//  var time =  document.getElementById('time');
		
// 		var Day=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"];

//   function date23(){
//  		var date =new Date();
//  		var y = date.getFullYear();
//  		var m = date.getMonth()+1;
//  		var d = date.getDate() ;
//  		var day = Day[date.getDay()] ;
//  		var h = date.getHours();
//  		var mi = date.getMinutes();
//  		var s = date.getSeconds();
//  		time.innerText = y+"-"  +m +"-"+ d +"---"+ day+"---" + h+":" + mi +":"+ s;

// }
// setInterval(date23,1000);
// 



  var obj = document.getElementById("time");

  box();

  function box(){
    var endTime = new Date(2017,5,6);//截止时间

    var currentTime = new Date(); //获取当前时间

    var time = (endTime - currentTime)/1000;//相差的秒数

    var day =checkNum( Math.floor(time/(60*60*24)));//天数

    var h = checkNum(Math.floor((time/(60*60))%24));//小时数

    var m = checkNum(Math.floor((time/60)%60));//分钟数

    var s = checkNum(Math.floor(time%60));//秒数

    var hm = checkNum(Math.floor((endTime - currentTime)%1000/10));

    obj.innerText = "距离高考还有" + day + "天"+ h +":"+ m +":" + s +":"+hm ;
  }
  setInterval(box,10);

  function checkNum(num){

    return  num <10 ? "0"+num:num;
    
  }

// //   var obj = document.getElementById("time");

//   box();

//   function box(){

//     time = new Date();

//     obj.innerText = time.toLocaleString(); 
//   }


// setInterval(box,1000);

 
  </script>

</body>
</html>